#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "hotkeytablemodel.h"
#include <QTranslator>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE


typedef enum{
    UI_ZH,
    UI_TC,
    UI_EN
}LANGUAGE;

Q_DECLARE_METATYPE(LANGUAGE)

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();



    void setLanguage(LANGUAGE current_language)
    {
        this->m_curLanguage = current_language;
        switchLanguage(this->m_curLanguage);
    }

    void setTranslator(QTranslator* translator)
    {
        this->m_pTranslator = translator;


    }
protected:
    virtual void changeEvent(QEvent *);

private:
    void initUi(void);
    void translateUI();
    void initData(void);
    void switchLanguage(LANGUAGE language);




private:
    Ui::MainWindow *ui;
    HotKeyTableModel *m_hotkeyModel;
    LANGUAGE m_curLanguage;
    QTranslator * m_pTranslator;
};
#endif // MAINWINDOW_H
